home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Info-Mac 4
/
Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso
/
Science
/
RLaB
/
rlib
/
num2str.r
< prev
next >
Wrap
Text File
|
1994-04-25
|
583b
|
28 lines
//-------------------------------------------------------------------//
// Syntax: num2str ( N )
// Description:
// Num2str converts the scalar-numeric argument into a string, which
// is the return value.
//-------------------------------------------------------------------//
num2str = function ( N )
{
local (s)
if (class (N) == "num" && type (N) == "real")
{
if (N.n == 1)
{
sprintf (s, "%.4g", N);
return s
else
error ("num2str: argument must be scalar");
}
else
error ("num2str: argument must be numeric-real");
}
};